from django.contrib import admin
from django.urls import path, include
from web.views import account
from web.views import home
from web.views import project
from web.views import screen
from web.views import manage

urlpatterns = [
    # 账户相关
    path('register/', account.register, name='register'),
    path('login/sms/', account.login_sms, name='login_sms'),
    path('login/', account.login, name='login'),
    path('image/code/', account.image_code, name='image_code'),
    path('send/sms/', account.send_sms, name='send_sms'),
    path('logout/', account.logout, name='logout'),

    path('index/', home.index, name='index'),
    path('', home.index, name='index'),

    # 项目管理
    path('project/list/', project.project_list, name='project_list'),

    # str,匹配除/的非空字符串，未指定转换器默认
    # int，匹配整形
    # slug， 匹配任意由 ASCII 字母或数字以及连字符和下划线组成的短标签
    # uuid，这个不知道干啥的
    # path，匹配包含/的非空字段
    path('project/star/<str:project_type>/<int:project_id>/', project.project_star, name='project_star'),
    path('project/unstar/<str:project_type>/<int:project_id>/', project.project_unstar, name='project_unstar'),

    # 大屏1
    path('screen/screen1/index', screen.screen1_index, name='screen1_index'),
    # 大屏2
    path('screen/screen2/index', screen.screen2_index, name='screen2_index'),
    path('screen/screen2/analysis', screen.screen2_analysis, name='screen2_analysis'),
    path('screen/screen2/people', screen.screen2_people, name='screen2_people'),
    path('screen/screen2/traffic', screen.screen2_traffic, name='screen2_traffic'),
    path('screen/screen2/activity', screen.screen2_activity, name='screen2_activity'),
    # 大屏3
    path('screen/screen3/index', screen.screen3_index, name='screen3_index'),
    # 大屏4
    path('screen/screen4/index', screen.screen4_index, name='screen4_index'),
    path('screen/screen4/car', screen.screen4_car, name='screen4_car'),
    path('screen/screen4/carContrl', screen.screen4_carContrl, name='screen4_carContrl'),
    path('screen/screen4/carTail', screen.screen4_carTail, name='screen4_carTail'),
    path('screen/screen4/correctSpecial_analysis', screen.screen4_correctSpecial_analysis,
         name='screen4_correctSpecial_analysis'),
    path('screen/screen4/validate', screen.screen4_validate, name='screen4_validate'),

    # 项目管理
    path('manage/<int:project_id>/', include([
        path('dashboard/', manage.dashboard, name='dashboard'),
        path('issues/', manage.issues, name='issues'),
        path('statistics/', manage.statistics, name='statistics'),
        path('file/', manage.file, name='file'),
        path('wiki/', manage.wiki, name='wiki'),
        path('setting/', manage.setting, name='setting'),
    ], None)),

    # path('manage/<int:project_id>/dashboard/', manage.dashboard, name='manage_dashboard'),
    # path('manage/<int:project_id>/issues/', manage.issues, name='manage_issues'),
    # path('manage/<int:project_id>/statistics/', manage.statistics, name='manage_statistics'),
    # path('manage/<int:project_id>/file/', manage.file, name='manage_file'),
    # path('manage/<int:project_id>/wiki/', manage.wiki, name='manage_wiki'),
    # path('manage/<int:project_id>/setting/', manage.setting, name='manage_setting'),
]
